﻿using System.Collections.Generic;
using SDCloudSolution.SDCloud.Entities.Identity.OAuth;

namespace SDCloudSolution.SDCloud.DataLayer.Interfaces
{
    /// <summary>
    /// Provides methods for works with <see cref="ClientApplicationEntity"/> data storage.
    /// </summary>
    public interface IClientApplicationDataProvider
    {
        /// <summary>
        /// Finds a <see cref="ClientApplicationEntity"/> by specific specific application identifier.
        /// </summary>
        /// <param name="applicationId">The application identifier.</param>
        ClientApplicationEntity GetById(int applicationId);

        /// <summary>
        /// Finds a <see cref="ClientApplicationEntity"/> by specific client identifier.
        /// </summary>
        /// <param name="clientId">The client identifier.</param>
        ClientApplicationEntity GetByClientId(string clientId);

        /// <summary>
        /// Finds <see cref="ClientApplicationEntity"/>'s that attached to specific user.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <returns></returns>
        IList<ClientApplicationEntity> GetByUserId(int userId);

        /// <summary>
        /// Inserts the new <see cref="ClientApplicationEntity"/> into storage.
        /// </summary>
        /// <param name="application">The application.</param>
        /// <returns></returns>
        ClientApplicationEntity Insert(ClientApplicationEntity application);
    }
}
